package com.core.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.core.entity.BaseLookup;

@Entity
@Table(name = "lookup")
public class Lookup implements BaseLookup {
	// ------------Apartment Status-------------//
	public static final Lookup APARTMENT_CONSTRUCTSTATUS_ONAIR = new Lookup(1L);
	public static final Lookup APARTMENT_CONSTRUCTSTATUS_BUILT = new Lookup(2L);

	public static final Lookup APARTMENT_RESERVATIONSTATUS_RESERVED = new Lookup(3L);
	public static final Lookup APARTMENT_RESERVATIONSTATUS_NOTRESERVED = new Lookup(4L);

	public static final Lookup APARTMENT_TAXESSSTATUS_PAYED = new Lookup(5L);
	public static final Lookup APARTMENT_TAXESSSTATUS_NOTPAYED = new Lookup(6L);

	public static final Lookup PAYMENT_STATUS_FINISHED = new Lookup(7L);
	public static final Lookup PAYMENT_STATUS_NOTFINISHED = new Lookup(8L);

	// public static final Lookup PAYMENT_FIRSTPAYMENT_YES = new Lookup(9L);
	// public static final Lookup PAYMENT_FIRSTPAYMENT_NO = new Lookup(9L);

	@Id
	@Column(name = "recid", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long recid;

	@Column(name = "name")
	private String name;

//	@Column(name = "lookup_type_id")
//	private Long lookupTypeId;

	@ManyToOne
	@JoinColumn(name = "lookup_type_id", insertable = false, updatable = false)
	private LookupType lookupType;

	public Lookup() {
	}

	public Lookup(Long id) {
		this.recid = id;
	}

	public Lookup(Long id, String name) {
		this.recid = id;
		this.name = name;
	}

	@Override
	public String toString() {
		return "Lookup [recid=" + recid + ", name=" + name + ", lookupType=" + lookupType + "]";
	}

	public Long getRecid() {
		return recid;
	}

	public void setRecid(Long recid) {
		this.recid = recid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLabel() {
		return this.name;
	}

	public Long getValue() {
		return this.recid;
	}

	public void setLookupType(LookupType lookupType) {
		this.lookupType = lookupType;
	}

	public LookupType getLookupType() {
		return lookupType;
	}

//	public void setLookupTypeId(Long lookupTypeId) {
//		this.lookupTypeId = lookupTypeId;
//	}
//
//	public Long getLookupTypeId() {
//		return lookupTypeId;
//	}

}
